package com.yuewen.permissioncheck

import com.android.build.gradle.AppExtension
import org.gradle.api.Plugin
import org.gradle.api.Project

/**
 * 用于 PathStatSDK 的插件
 */
class PermissionCheckPlugin implements Plugin<Project> {

    @Override
    void apply(Project project) {
        println "===================="
        println "PermissionCheck Plugin Start"
        println "===================="
        project.extensions.create("PermissionCheckPlugin", PermissionCheckExtensions, project)
        def android = project.extensions.getByType(AppExtension)
        //注册 Transform，操作 class 文件
        android.registerTransform(new PermissionCheckTransform(project))
    }
}